<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <div>{{count}}</div>
        <div>
            <button @click="increate">添加一次</button>
            <button @click="decreate">减少一次</button>
        </div>
    </div>
</body>
<script src="../../js/vue.js"></script>
<script type="text/javascript">
    var vm=new Vue({
        el:'#app',
        data(){
            return{
                count:0
            }
        },
        methods:{
            increate(){
                this.count++
            },
            decreate(){
                this.count--
            }
        }
    })
</script>
</html>
